package org.weed.remote.ui;

import java.awt.Image;
import java.awt.Rectangle;

import javax.swing.JFrame;

public class RemoteMonitor extends JFrame {
	private static final long serialVersionUID = -7258671579560747533L;
	
	private ImagePanel monitor;
	
	public RemoteMonitor() {
		
		
		
        

	}
	
	public RemoteMonitor(Rectangle screenSize) {
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		this.setLocationRelativeTo(null);
		this.setTitle("Remote Monitor");
		
        monitor = new ImagePanel();        
        monitor.setSize(screenSize.width/2, screenSize.height/2);
        
        this.getContentPane().add(monitor);
        this.pack();
        this.setLocation(200,200);
        this.setVisible(true);
	}
	
	public void refresh(Image image) {
		monitor.setScreen(image);
		monitor.repaint();
	}
	
	public static void main(String[] args) {
		RemoteMonitor m = new RemoteMonitor();
		m.setVisible(true);
	}
}
